import url from '@/tool/index.js'
//预约订单
export const checkToken = (token) => { //检测Token是否过期
	return new Promise(resolve => {
		uni.request({
			url: url + '/api/token/check',
			data: {
				token: token
			},
			header:{
				'Content-Type':'application/x-www-form-urlencoded'
			},
			method: 'POST',
			success: (res) => resolve(res.data),
		});
	})
}

export const refreshToken = (token) => { //刷新Token
	return new Promise(resolve => {
		uni.request({
			url: url + '/api/token/refresh',
			data: {
				token: token
			},
			header:{
				'Content-Type':'application/x-www-form-urlencoded'
			},
			method: 'POST',
			success: (res) => resolve(res.data),
		});
	})
}
